add function now handles negative numbers