finished the coding portion