adding code from reactive course on coursera