initial commit, still needs testing and more comments and scaladocs