stock lib working +tests