add algorithm stuff