Added tests and stock recuperation