added gistic. make things testable (option to specify directory)