new algorithms with scala