changed nullptr to NULL to avoid c++11 (failed to build on linux)
replaces tabs with spaces