add more commenting and a OS check for the compiler flags