add echo statements for debugging and pretty printting