Added writing to groups 2 and 3