Added more comments and structure