fixed hex reading
fixed memleak
added frequency table reading