adding tilebag code changes, updated unit tests