Initial validation added, untested code.