Final Solution for Submission