added initial code but functions undefined error