Slightly changed format of functions.