renamed some variables and updated documentation