added length < 0 check for warning
changed Z axis direction; might be bollox