added first/last functionality