updated uart example, uses classes