Scanner written - first attempt