Adding function: checkBlock(), write(), login(), complete login function