misc. cleanup, added rounding functions