fixing vars and removing logstuff