implemented Div function