added header and fixed issues