Added method which creates an object with the input number