Submission version. Added testing support. Prune words shorter than 3 characters.