Completed Main Code.