add data structure and LS function to .h