update to documentation. Clean up less-efficient methods. Added helper for making a frequency array