Merged some functions.