implemented more functions
added more tests