cleaned up formal functions