added dead-end functionality; extended tests;