Updated EA subrotuine