code for first submission