removed unnecessary use of malloc