added a class and updated main