Heriot youngsters voluntarily spent part of last weekend at the village school in a bid to raise awareness of homelessness.
Twenty-three pupils from primaries four to seven slept in the school hall on Friday night in support of homelessness charity Social Bite.
The youngsters were recently crowned champions of an online maths contest, run by website Sumdog and Social Bite and, inspired by a presentation from the representatives who handed over the trophy, decided to organise their own fundraiser for the charity.
Children, staff and the after-school club at Heriot primary organised the event which saw youngsters set up camp in the hall from 7pm.
Pupils paid to take part, and the programme for the night included rounders, den building and other outdoor games early on. After dark, there was hot chocolate and a snack, movies and games before a midnight snack, hide and seek with torches, star-gazing and breakfast the following morning.
The £140 raised will be split between the school and Social Bite.
z Maths contest winners from Heriot primary school – back row, from left – Flynn Walker, Gabriel Pettitt, Lonella King, Abbi Scott, Heather Brinkworth and Evan Henderson; front – Liam Bell, Sofia Pirone, Kayah Leszewska, Saul Henderson, Cameron Wallace and Sarah Pate.