attempts to include advanced pattern matching