groundworks
added some tests and implementation