revised add and divide methods to improve efficiency