added most of the bl functionality