added default to beginning or end option