merged Paddys changes
added tests, updated setup