added fine-tuning of spike detection parameters