Updated and added a few functions.