Made some imrpovments