Made some modifications & bug fixing