Finish prog2 and fixed erros