replace first, second with lambda x: x[1/2]
edits from writing blogpost