Fixed two functions to actually return a value