Adapted Dustin's code in advanced installation