Updated with aux. functions