Refactor Next implementation
Fix: error should not use nil val
Move things around because aesthetics
Do not export nextPotentialLocations
Remove superfluous break in Next implementation