Taken copy of PRWD_Autoshipping and adjusted to magento coding standards