Rewrote to permit type inference
Fixed dependencies, new version