resolves #434, need to be fully tested