Added ray formula, some calibration stuff