Simplify code with JSONTokener
Implement a working but inefficient solution