made a main scoping object to keep state without globals