using lib.sh for important functions