sets up test environment
fixes syntax issues and tests