A scala implementation of useful algorithms