Fixing the last of and changing to ofType