renamed most of the variables and structs