fixed some cosmetic changes and const