generate package stm at the top