added some tests and some functionality