added functionality

the added functionality does not yet work but the lines are correct.