Document functionality added and thanks to Narango