tested on jasmine