added code to properly format output (attempt