solutions to the programming problems