solutions to earlier exercies