Neatened some code & fixed naming issue.