made it accept an array of objects
enabled requestanimationframe