Create gb_ops.c

most stuff here can be done shorter