define SIMULATOR during builds
code documentation; misc. cleanup and fixes