fix some numbers loading as nan
some refactoring, added protected versions of functions
added tests related to protected functions
updated docs
updated README