re-adding Max's edits to SmallK