added code to expose function - broken at the moment