working through substitution - comments added