fixed some bugs
readded hpp header files