Changed to be more general for others to use

Changed after successful test on Magento 1.8