updated to use ybs code