fix missing header + code cleanup for SPARC