order frags by density, ruby methods