Implemented divide function.