Implement Scan Logic (unfinished)