Fixing $input variable, removing debug statement