knock code functionality finished