Cleaned code for submission