wrote initial code