comments and some code styling