Added logger and some comments