final cleaning  up of code for submission