Function to determine start of frame.