merged changes from automapping branch and unit tests that work