merged two files

calState and getData to getAllStates