Modified main code to make it NOT use pointers, this should make it less difficult to understand