hw4, pattern matching, guarded equations