Changed some code style and added some code.