Changed back to malloc need to implement stat