Fixed infity loop - division by 1 or 0