added stock functionality