Added misc changes to include guards and added an initBuffer function.