moved solutions from worksheet to scala file