parsing commands and first search