updated the solution for part one