method for converting integer into binary