Most of scanner implemented