updated comments and organization