updated comments and updated order of vars