Add code from http://code.google.com/p/vamcart/source/browse/