Improve input handling in the method. Almost there. Still some work to do :)