Updated with new functionality