Some algorithms with tests