Implementing a solution in Akka