Solutions to Homework 5 - rides and elevators