Need help with java implementation of chord program.