Renamed appropriately, functions work

JavaScript and C++ code fixed