Added transitions and some minor changes