updated code for submission