implemented last n with 3 hardcoded