work against issue #38
implements issue #54 (added also first and last), and removed something from #38.
merge