modularizing code and declaring function new function