Handle negative position (from the end)
add attributes support