re-vamped with mapperThread class added