start adding unit testing and correct things