a mess but makes more sense