Cleaned up possibly_code method