- added reference queries
- added prototyped functions