changed long format into a table