rewrite linear formula to match th magical site