basic implementation of TSP for PHP Magazin