Finished basic versions of last two functions