Wehre were medival towns founded? Why there?