Cleaned up some variable names, plus commenting