allocatig the dimensions on the heap