Some comments added.
bug fixed