added precondition to addTo
added test