makes archive.php a bit more intelligent