private bool isLaserLocked(double threshold, double error) { if (-threshold <= error && error <= threshold) { return true; } else { return false; } }