Added currentSelection function and related PDF