Fix flushing, add R shit