added unit tests for demo
fixed merge issues