First version complete with error handling.