Write method to merge two states

Write method to merge two states together into one state