basic code structure and implementation