added lending functionality