solution to problem ATM