solved problems 1-8, that are previously solved with Scala.