solutions to scala99