Made Bitsim an object to get rid of global variables and make code easier to use with other objects