most code written for lab4