took stuff from play ref