Replaced setInerval with rAF