changed some variable names, add notes