Added some comments, reorganised .h and removed unuseful code