cleaned version Lab6