merged with habib's branch