Fixed divide function and added div function