Adding the jasmine tests
Add the jasmine tests and update the code