most of basic code there