Modified lib to also be able to use locals