added tests for reverse function