abstracted function call and added raise
added boolean operations