Cleaned up some stuff

organized the code, made it more structured, and changed the header name slightly