modified to use extended add lib