add code from st405 lecture 1