fixed default indexing

changed the default keyValue and added the option to pass in a variable
name index in addition to just the name. This required adding a
function that checks to see if keyValue is a number.