Fixed logic fuckup. I write too much Perl