designing, implementing function to determine whether or not space is available for a block
separated block-specific code into blocks.js