All parts implemented. Needs testing and tuning.