fixed bugs and added testing to logger