final version with errors from #13. (turned earlier one in)