added cabal file and fixed some minor bugs