Fix step triangle and optimize