updates to header and bug fixes