Updated 1st solution for better readability