added edit code and delete functions