last major code changes. start of fine tuning.