tweak resource buff, improve doc comments, add resource Squash function