Final version of Lab5.v2