fixed minor stuff; renamed some vars.