I agree with
>>2 about the grades. Getting a tutor is a good way to try and bring your math grade back up. You could try and find a tutor your age, then you can try and build a friendship with the tutor, who will then introduce you to his/her friend group, which will then widen your friend group. Besides that, all I can say is you should probably see your teacher for help with math and possibly see if there's any extra credit you can do to bring your grade back up. As for the being quiet and shy, that's just something you will have to overcome if you want a large group of friends. Start conversations with people instead of waiting for people to start ones with you. It's hard when you're shy, but you will eventually get past that after enough conversations with people.