Updated and added a few new functions