Ankur Aggarwal's puddle solution