Changed variable names to allow compiling with c++