code for the first assignment