Updated based on suggestions from rcuhljr

also played around with the format of the output