Changed malloc

Since most people really dislike casted output of malloc I removed it.
Also changed sizeof to point to variable instead of type