working version for jasmine