added more algorithm