more cleaning up and using correct attributes