Improving P300 Speller performance by means of optimization and machine learning