Solution for lab 4