score logic