Added some generic algorithm funtionality