use NULL instead of 0 and better structure