Final code for the final project