furher modifications on modes, bug fixes