Merge code from GYM