better one without intermediate file generation