new logging method. fixed some things. etc.