Renamed some stuff to make the code more understandable