write some tests, find a bug