Made lecturize method more pythonic