added getting the last element key

This allows getting the last array key instead of only the value