Implemented features described in issue #23.