Worked on scanning. Also added some constants to make things easier to
understand.