another version with pretty printting