fixed null pointer
documentation overhaul