fixed typo
more elegant output
central variable definition