Updates and corrections on code