frame logic implementation