Undoing changes to code sample - they ended up not working as intended.