Reformatted code, added in the ability to add operators through and makes sure attribute values are valid