last commit

merged barrys code with mine and changed some of the JavaScript var
names