fixes cascade type resolution and added corresponding test
fixes imports + indentation and adds comment