creating map from DB table
finding paths from SB