modied a little bit