fix bug and implement more functions in g03.py