Tightening up code
Added timeout
Fixed incorrect IP used; vars should be hash, not array