works just as well with vinyl
cleaned up, added type safety
fix mistake in last commit
Merge branch 'master' into vinyl