Updated functions in lib