update comments, rename variables