updated code

added id's and optimized code related to white and black coins.