implemented scanRight