adding tests and a little documentation