finished algorithms for sec int