Implemented measure and added more tests