More work on chord algo -- closer to working