Updated to use efuntions (https://github.com/marcusatbang/efunctions/)