xgm: added color object, added integer indexing, fixed some bugs