Add .code method to scripts + tests