unit tests for algorithm