Avoid division by zero
Change util function from JS to CS
Add 'capitalize' function