proper solution for lab4