hacked together re-extract functionality