Continue fleshing out function from py-rail.