fixed: buffer overflow which meant my input string was wiping out threshold (next to it in memory). fixed by making input string fixed length for now.