added function prototypes etc.