working on frame update logic