Lab4: doesn't work properly