merged old code review fixes
finished merging fixes