created better variable names and more comments for simplicity and maintability