command lookup is done, might want to clean code further.