Added tests
fixed merge conflicts