some code written while learning.