finished code for g4g11