finished writing up everything but need to fix clock and add unit tests.