fix legend
add comarator, start of README and fix bufferedwriter by adding .flush()