fix forward propagate implementation to pass test
refactor forward propagate implementation