Extended comm code to support all functions