Initial code review of current code base

comment explaining why these flags are set would be good