Some comments added
Code reformatted