fleshed out some functions