modified print so it now works with variables, need to work out how we are handling list variables