algorithm doing sitp