current local working version. needs cleanup.