Input detection properly implemented.