added code from step7