Fixed several loop bugs, and finished Logger class