Implement Spy function
Merge branch 'implement_spy'