added first and last buttons