Refactored the code - packed into one class and checked it the results are the same with previous (multiple list) implementation