copy droplast/1 last/1 from erlang stdlib