added some tests and functions