basic code and testing framework