new tests, cleaned up some functions