fix the algorithm by adding N-out-of-M support. Removing test files (not needed) and added Unit testing. Work not yet complete.