variables and minor fix