add more tests, code by scuben