fixed some little bugs, started implementing logging