Getting closer, but messed up the get-rests function (I think).