added NIO CSV output + code cleanup