Implement basic malloc function