redesigned and implemented the SSA algorithm