Final code for ME575 project.