Modified so only integer input is allowed.