Added basic comments and code organizations