Ah, so there is an inbuilt method for that, Thanks!