added transitions, some cleanup