added documentation, small fixes, deleted garbage