various tasks from headfirst book