added several helper functions, expanded casework section