fixed cc warnings, added newlines