renamed some stuff and moved some stuff around to make it more readable