Final draft (minus robustness testing). Fixed boundary issues, streamlined & improved error checking, polished all files.