add some comments
add several optimisations
improve manipulation methods