completed implementation with create_id function