Redid all the connecting functions so it is a lot easier to read and work with!