fixed bugs from previous lab (pre dev branch)