initial code implementation