Added some input processing