try to consolidate all code to python-style sequence bounds (including start, excluding end)