update process_attributes to be more clear as to what is happening

I'v made some changes to the `process_attributes` method that I feel make it a little more understandable. It is functionally the same (I think...could use a second pair of eyes though).