added some more functions
added some tests and modifications to support them