homework6 for EWD course