improvements and tests for slice