working version without routing selection