Trying to Figure Out the Math in Portal