Income allocation between states.

I lived in CT for 5 months to start the year and worked in CT and sometimes although rare, in MA. Then I moved to MA and lived in MA for 7 months but still worked in CT full time with some travel to our MA office. Therefore, I have wages from both states and state income tax from both states. I am concerned I am not reporting this correctly. Could you help me out or give some information that might be helpful.