Updated code, and added classes.