added extra documentation
cleanup commented code