using sscanf, using helper functions