Implemented ttl. Resolves #4.