using code instead of command