fixed some const correctness stuff