Changed naming of parameters and minor improvements