added trigger keep
factorised step3 code
added hlt
finished trigger