replaced algx with main