Converted to Perl and Rewrote how checks are done.