Adding database files and fixes to routingalgorithm