my solution to S99 problem sets