fixed printerror a bit, needs rewriting ideally i think