adapated to etcbc4