Source.cpp

- JavaScript ported from this original code