added more tests and completed the basic functionality