re-wrote output