closes #7, half of #8 implemented