work in progress to implement functions