Minor changes, fixed some var name typo.