updated version of assignement ...late work