added formula for finding resistance