first big initial refactor, adding in libraries