fixed algoritm beetle