Update code to suit the input requirements