Added logic for restock
Merged with master