implementation of part 1 completed
cleaned up return value