adding ea class and a modified main version