Trying to restructure output