4 out of 9 tests failing... but fixed the missing end error...