Modified the complete parsing function and added device definition