fixed class removing, and took out rendering out to a new function