implemented coin detection
merged