cleaned up code up to part 1 step 2