half done / added a few functions