Final version + comments added