filled in some calls in main, also added functions files