Algorithm buttons now working properly