added cyrilf7's changes