implementing wms logic