functions appear to work correctly throughout, testing to be done