Vast improvements:
- added wildcard function for dealing with wildcards nicely
- comment descriptions added throughout