Algo2 and database improvements