Improved C++ Version (215 -> 175). Evil hacks used!