Added unit tests and implemented UMD