added perf test and debug and passed the tests