fix some stupid errors, and use Beacon pattern as a test input