Added code to handle 0 properly.