Code for final Submission