rewrite lab5