added structure for stm algorithm