Updated the code to SJGL 0.9