converting spaces, removing extra code