add circular reference and learnt function scoping again