Add new functions and update from MarkSamman