finished basic implementation of scanner