Updated code
Updated with new gui