detects the differents commands and seperate them