started using match and debugging