Added helpers for lecture 8