making it recursive...ish