Improved anaconda function