Re-wrote Part A since the main project wasn't working