Mostly finishes the code for the last part of lab 2