Trash function almost complete