added option to benchmark examples, reorganized benchmark code