Added Threading

Note: Code still doesnt work as advertised