Simplify scan function

I've simplified the scan function using [string.split](http://docs.python.org/2/library/string.html?highlight=split#string.split).