added helper functions for easier creation of algorithms