updated for preprocessor define in tinderbox anf fixed math bug in sample