change variable name and minor updates on code layout