orgainizing code in 2_4