added support for negative step index