cleaned up the code from Thursday