Automated Merging Control Algorithm: A Cooperative Approach for Connected Automated Vehicles in Platoons