minor revision, transfer fucntions added.