Added initial code, and function prototypes for common functions