renamed some variables to increase readability