major modifications. documentation to be updated