basic code structure. Not tested to work right now.