Added basic algo functions