endscore logic contd