I forgot to put the starting position in the visited dictionary, so the starting part will always split into two..sry..