Changed coding conventions and added some comments.