implemented changes suggested by Markus