added pre- and postconditions