added null-checks
added TODO