fixes for lect 3 and 4