big rewrite to accomodate catalyst.pl not being there