Added textual answers and sample code.