changed ATP counting in template