Some comments added.
Main is updated with return value and arguments