Remove malloc

Fixed issue #9