There are some 8 space indentation mixed into the code here. Would be nice if all is 4 space intended