Added extra functions. No error handling taken into account for.