Updated with increased functionality