some documentation and removed not necessary variable