fixed a bug around sorting memos by health and removed some unused code around sorting