close #18, tested lightly but should be working.