Removed unnecessary malloc, added some comments, small fixes