Used char calculation instead of magic number