removing unused variable
added more documentation