rearranged, trying to make it a real gem