Improve dig functions