Upstream Updates

Added a license, changed some math, and added disable functionality.