Second version of assignement2