tweaked script and how we export the lib