adding the clock class and wrote basic simulation code