code changes reveted back from messed up merge