added more functions and jasmine unit test