added checksig function - unfinished at present