more changes to command; ebtter but needs effiency improvement