- slices are now Python-style (support negative indices)
- reformatted code