added better solution to part 1, finished part 5