added test class and implementation