replaced slice algorithm in HelloTriangle project