Updated with new implementation