initial commit
dynamic memory allocation and check encoding on input