Input class refactored, everything seems to work