better documentation, removed some comments