better docs and removed dumb code