Changed it up to use same file for form and processing. Made algorithm self-documenting.