merge #12 and #22 into master (preapproved)