old, uncleaned code with extensive notes