Here is the class. Also added tests