initial version with some tests