set up all functions
first pass at filling out functions, still need to test everything