added update version of prog_proj2 with fixed bugs and add and avg options