merge conflicts and fixed bug in registration