Update 6.rkt

Includes tests and error checking for main function.