First working version. Developed and tested on Magento CE 1.8.1.0.