clean up done to master, pushed to nk_update

cleaned up code from master and committing the changes to nk_update so
as to not interfere with master