updated CSG1132 lecture 5a and 5b