fixed shadowed names to avoid possible bugs and quell compiler warnings