replace explicit malloc.h with stdlib.h, also converted everything from dos line endings to unix