more code documentation and deleting dead code