Added logging + comments