updated forward code