added implementations for patterns