Changed timing method and added invalid cases to average pipeline. Works reasonably well now.