App can now handle null inputs, out of bounds, and code is neater