all the rest of the logic