initial code and discussion