Refactored CE1 based on comments.