Added test

Test for class added and class was reworked for better performance.