changed few functinos