Added a bit more functionality to parray()