fix outputted code