finishing touches

fixed rounding error, nested if into if/else