Updated comments and code formatting