change coin to use for loop for better code