added shared variables
changed document ready position, debugged tracks index