added comments and structure