Some code you can use! | ScratchStats