added word counter to load function for use in size function later
moved root and cursor to be accessed gloabally especially by check function
check function not fully implemented