Written most of logic for Scanner Return