Transition works as expected. Removed width first height animation. Removed redundant code.