works right and logs sanely