final version with comentaries