Weekly rest and reduced weekly rest question

Hi , I have a question regarding Weekly rest and reduced weekly rest. I have been driving now for about 2 months and still struggle a little with weekly rest in regards to working 1 day at the weekend . from my understanding if I take a full 45hours the weekend before I can work the current weekend for 1 shift providing my weekly rest for that weekend I work is no less than 24 hours (reduced). then the next week take a full 45 hours( no work on the weekend). my boss has asked me to work Sunday this week so need to make sure. I have put my last week of work (week1) and my Current week (week 2) for what he wants me to do on Sunday.

Week 1

Mon: 0800-1600
Tue:0800-1600
Wed:0800-1600
Thu:0800-1600
Fri:0800-1600
Sat: 0ff
Sun:off

Week 2

Mon: 0800-1600
Tue:0800-1600
Wed:0800-1600
Thu:0800-1600
Fri:0800-1600
Sat: 0ff
Sun:16:00-2000

Then a normal week with a full 45 hours at the end of it.

This may seem a silly question to some but would help me massively if some could clarify if this legal and above board.

Thanks

This is legal as regular weekly rest every week

Week 1
Mon: 0800-1600
Tue:0800-1600
Wed:0800-1600
Thu:0800-1600
Fri:0800-1600
Sat: 0ff
Sun:off = weekly rest of 64 hours

Week 2
Mon: 0800-1600
Tue:0800-1600
Wed:0800-1600
Thu:0800-1600
Fri:0800-1600
Sat: 0ff = weekly rest of 48 hours
Sun:16:00-2000

thanks for the reply, did not even realise I have cleared the 45 hours before I start the Sunday shift from when my last shift ended. I’m sure I will get the hang of it eventually.