improving command detection, still not finished