Const correctness

I was unexperienced when I wrote this code :(