added formatOutput option