Input/Output stage correct. Use eventDetection(input,output). Main deprecated.