updated changes submitted by Mauno