cleaned-up and improved postprocessing. Should now work on pacman