some major modifications