Changed method of detecting side.