added log and stuff