Use remainder theorem (#307)