add BED type, modified other functions to adapt the new type
use state monad to parse bed