tests and some code funness