use 0 instead of null. import necessary libraries. fixed typos.