Working Updated Version (need to update GUI)