Returned to minimal functionality, minor style fixes, added test (not working properly yet)