changed code to fit changed assignment