add scan function + rest of basic stuff