added header file and fixed warnings