closes #292 merged manually