Added voigtan's changes