removed redundant console.logs and nulls