Finished misc. functions.