update with my solution to programming2