debugged and changed character into a class