Code Cleanup

removed unnecessary code
added variable for transition length