algorithms now loading and saving to database