Cleaned up. Build fails; will refactor to use STM soon.