Bug fixed

* Use the correct way to extract the column names

* Produce the final result with correct dimensions