re-arranged to make more sense