modified some variable names and set some variables to private